//
//  ScrollViewOneTableViewCell.m
//  OneDay
//
//  Created by lanou3g on 15/11/2.
//  Copyright © 2015年 oneDay. All rights reserved.
//

#import "ScrollViewOneTableViewCell.h"

@implementation ScrollViewOneTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    self.picture = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kWidth, 350)];
    
    self.picture.backgroundColor = [UIColor cyanColor];
    
    [self.contentView addSubview:self.picture];
    
    
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kSpace, kSpace + self.picture.bottom, 100, 50)];
    
    self.titleLabel.backgroundColor = [UIColor redColor];
    
    [self.contentView addSubview:self.titleLabel];
    
    
    
    self.authorLabel = [[UILabel alloc] initWithFrame:CGRectMake(kSpace, kSpace + self.titleLabel.bottom, 150, 30)];
    
    self.authorLabel.backgroundColor = [UIColor yellowColor];
    
    [self.contentView addSubview:self.authorLabel];
    

}

- (void)setModel:(ScrollViewNextModel *)model
{
    if (_model != model) {
        _model = model;
    }
    NSString *url = [kStyleTotalPhoto stringByAppendingString:[NSString stringWithFormat:@"%@",model.image1]];
    [self.picture sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:nil];
    self.titleLabel.text = model.title;
    self.authorLabel.text = model.authorbrief;
    
    
}






- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
